/**
 * 取消入职
 */
import React from 'react';
import AuthComponent from '@/utils/auth/AuthComponent';

import { Icon } from '../../components';
import HireCancelModal from './HireCancelModal';

function HireCancelOperate({ employId, onConfirm, talentName, ...rest }) {
    const [visible, setVisible] = React.useState(false);

    const modalProps = {
        visible,
        setVisible,
        employId,
        onConfirm,
        talentName
    };

    const handleClick = () => {
        setVisible(true);
    };

    return (
        <AuthComponent code="office:recruitment:course:hire:cancel">
            <Icon title="终止入职" type="zhongzhiruzhi1" onClick={handleClick} {...rest} />
            <HireCancelModal {...modalProps} />
        </AuthComponent>
    );
}
export default HireCancelOperate;
